<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<%
	String path = request.getContextPath();
	// 获得本项目的地址(例如: http://localhost:8080/MyApp/)赋值给basePath变量 
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	// 将 "项目路径basePath" 放入pageContext中，待以后用EL表达式读出。 
	pageContext.setAttribute("basePath", basePath);
	//out.write(basePath);
%>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>学生选课系统</title>

<meta name="description"
	content="Source code generated using layoutit.com">
<meta name="author" content="LayoutIt!">

<link href="<%=basePath%>bootstrap/css/bootstrap.min.css"
	rel="stylesheet">
<link href="<%=basePath%>bootstrap/css/style.css" rel="stylesheet">

<script src="<%=basePath%>bootstrap/js/jquery.min.js"></script>
<script src="<%=basePath%>bootstrap/js/bootstrap.min.js"></script>
<script src="<%=basePath%>bootstrap/js/scripts.js"></script>
<script type="text/javascript">
	function selected() {
		alert("选课成功！")
	}
</script>
</head>
<body>

	<div>
		<h5 align="center">欢迎来到选课系统</h5>
		<table class="table table-bordered table-hover"
			style="text-align: center;">
			<tbody>
				<tr class="success">
					<td>#</td>
					<td>课程名</td>
					<td>教师名</td>
					<td>选课</td>
				</tr>

				<c:forEach items="${sessionScope.lst}" var="eachuser"
					varStatus="statu">
					<tr>
						<td>${statu.index+1}</td>
						<td>${eachuser.classname}</td>
						<td>${eachuser.teaname}</td>
						<td><a
							href="SelectClassS?classname=${eachuser.classname}&teaname=${eachuser.teaname}" onclick="selected()">选课</a></td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
	</div>


</body>
</html>